import req from '@/http/http'
import {getServer} from '@/http/AppApi'

let ZHPQ_SERVER = getServer()

// 事件上报接口
// 待办任务
export const getBacklogTasks = data => {
  let path = ZHPQ_SERVER + '/event/acceptance/tasks'
  return req.get(path, data)
}
// 查询当前用户办理过的任务列表
export const getHistoricTasks = data => {
  let path = ZHPQ_SERVER + '/event/historic/tasks'
  return req.get(path, data)
}
// 完成任务
export const finishTasks = data => {
  let path = data.isWorkflow ? ZHPQ_SERVER + '/event/runtime/task/' + data.taskId : ZHPQ_SERVER + '/event/' + data.businessId
  return req.put(path, data)
}
// 新增事件上报
export const createEvent = data => {
  let path = ZHPQ_SERVER + '/event/'
  return req.post(path, data)
}
// 根据id查询当前事件详情
export const findEventDetail = id => {
  let path = ZHPQ_SERVER + '/event/' + id
  return req.get(path)
}
// 查看工作流任务流转
export const getTaskTimer = data => {
  let path = data.isWorkflowTimer ? ZHPQ_SERVER + '/event/trace/history/' + data.procsInsId : ZHPQ_SERVER + '/event/trace/history/user/' + data.businessId
  return req.get(path)
}
// 获取工作流任务跟踪图
export const getTaskPhotoUrl = isProcsInsId => {
  let path = isProcsInsId ? ZHPQ_SERVER + '/event/trace/photo/' : ZHPQ_SERVER + '/event/trace/photo/user/'
  return path
}
// 查询驳回原因
export const gitRrasonList = data => {
  let path = ZHPQ_SERVER + '/dictionary/list?keyName=驳回原因分类'
  return req.get(path, data)
}
// 查询处置反馈 分页
export const findVerificationEvent = data => {
  let path = ZHPQ_SERVER + '/event/feedback/tasks'
  return req.get(path, data)
}
// 督察督办
export const findSuperviseEvent = data => {
  let path = ZHPQ_SERVER + '/event/inspector'
  return req.get(path, data)
}
// 督察督办删除
export const delSuperviseEvent = data => {
  let path = ZHPQ_SERVER + '/event/manage/' + data.id
  return req.delete(path)
}
// 设置预期等事件状态
export const updateSuperviseEvent = data => {
  let path = ZHPQ_SERVER + '/event/manage/' + data.id + '?type=' + data.type
  return req.put(path, data)
}
// 考核评分
export const findAssessmentEvent = data => {
  let path = ZHPQ_SERVER + '/event/assessment'
  return req.get(path, data)
}
// 结案归档
export const findExamineEvent = data => {
  let path = ZHPQ_SERVER + '/event/close'
  return req.get(path, data)
}
// 结案归档导出
export const getExportFileUrl = data => {
  let path = ZHPQ_SERVER + '/event/close/export'
  return path
}
